/*
 * @Author: wangqizhang
 * @Date: 2024-05-07 09:27:27
 * @LastEditors: wangqizhang
 * @LastEditTime: 2024-05-07 09:32:43
 * @FilePath: /suixinji-react/src/store/modules/userStore.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import { createSlice } from '@reduxjs/toolkit';
const userStore = createSlice({
  name: 'user',
  initialState: {
    userInfo: {},
  },
  reducers: {
    setUserInfo: (state, action) => {
      state.userInfo = action.payload;
    },
    clearUserInfo: (state) => {
      state.userInfo = {};
    },
  },
});
const { setUserInfo, clearUserInfo } = userStore.actions;
const userReducer = userStore.reducer;
export { setUserInfo, clearUserInfo, userReducer };
export default userReducer;
